//
//  RABookDetailModel.m
//  ReadApp
//
//  Created by 飞猪 on 2018/11/8.
//  Copyright © 2018年 Facebook. All rights reserved.
//

#import "RABookDetailModel.h"

@implementation RABookDetailModel

- (void)encodeWithCoder:(NSCoder *)aCoder {
  
  [aCoder encodeObject:_bookId forKey:@"bookId"];
  [aCoder encodeObject:_bookName forKey:@"bookName"];
  [aCoder encodeObject:_bookCover forKey:@"bookCover"];
  [aCoder encodeObject:_bookAuthor forKey:@"bookAuthor"];
  [aCoder encodeObject:_status forKey:@"status"];
  [aCoder encodeObject:_words forKey:@"words"];
  [aCoder encodeObject:_bookIntro forKey:@"bookIntro"];
  [aCoder encodeObject:_bookClass forKey:@"bookClass"];
  [aCoder encodeObject:_categoryId forKey:@"categoryId"];
  [aCoder encodeObject:_chapterCount forKey:@"chapterCount"];
  
}

- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder {
  
  self = [super init];
  if (self) {
    
    self.bookId =  [aDecoder decodeObjectForKey:@"bookId"];
    self.bookName =  [aDecoder decodeObjectForKey:@"bookName"];
    self.bookCover =  [aDecoder decodeObjectForKey:@"bookCover"];
    self.bookAuthor =  [aDecoder decodeObjectForKey:@"bookAuthor"];
    self.status =  [aDecoder decodeObjectForKey:@"status"];
    
    self.words =  [aDecoder decodeObjectForKey:@"words"];
    self.bookIntro =  [aDecoder decodeObjectForKey:@"bookIntro"];
    self.bookClass =  [aDecoder decodeObjectForKey:@"bookClass"];
    self.categoryId =  [aDecoder decodeObjectForKey:@"categoryId"];
    self.chapterCount =  [aDecoder decodeObjectForKey:@"chapterCount"];
    
  }
  
  return self;
  
}

@end
